package com.docmgmt.mvp.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 访问分享链接响应
 *
 * @author Dora
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AccessShareResponse {

    /**
     * 文件信息
     */
    private FileInfo file;

    /**
     * 分享者信息
     */
    private SharerInfo sharer;

    /**
     * 过期时间
     */
    private LocalDateTime expireTime;

    /**
     * 是否允许下载
     */
    private Boolean allowDownload;

    /**
     * 文件信息内部类
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FileInfo {
        private Long id;
        private String name;
        private Long size;
        private String extension;
        private String previewUrl;
        private String downloadUrl;
    }

    /**
     * 分享者信息内部类
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SharerInfo {
        private String name;
        private String avatar;
    }
}
